package com.example.wallet.bean;

import com.alibaba.fastjson.annotation.JSONField;
import com.example.wallet.R;
import com.example.wallet.global.AppGlobals;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;

public class BalanceInfoBean implements Serializable {


    /**
     * list : [{"tokenType":"SST","title":"1 SST ≈ 1 CNY","balance":264355.37,"balanceCny":264355.37,"isSupportTrans":1,"isSupportReceive":1},{"tokenType":"SSL","title":"1 SSL ≈ 0.15 USDT","balance":263771.36,"balanceCny":-584.01,"isSupportTrans":0,"isSupportReceive":0},{"tokenType":"CML","title":"1 CML ≈ 1 SST","balance":11478.803,"balanceCny":11478.803,"isSupportTrans":1,"isSupportReceive":1},{"tokenType":"ARL","title":"1 ARL ≈ 1 SST","balance":973.43,"balanceCny":973.43,"isSupportTrans":1,"isSupportReceive":1}]
     * totalBalance : 276807.603
     * totalBalanceCny : 276807.603
     * balanceInfo : {"bid":2,"uid":2,"walletAddress":"0xc3218c111132e70b05171e9c33af42d6ca2c14bf","sstBalance":264355.37,"stBalance":0,"usdtBalance":0,"updateTime":"2020-10-10 14:53:34","userNumber":"8296497","v1TreePt":0,"v2TreePt":0,"v3TreePt":0,"v4TreePt":0,"v5TreePt":0,"v1TreeHy":0,"v2TreeHy":0,"v3TreeHy":0,"v4TreeHy":0,"v5TreeHy":0,"v6Tree":0,"eusdBalance":1000,"cmlBalance":10468.803,"cmlBalanceLock":11,"account":"12313123313","sslBalance":-584.01,"arlBalance":13.43,"scmlBalance":1010,"sarlBalance":960,"sstBalanceLock":null}
     */

    @JSONField(name = "totalBalance")
    private double totalBalance;

    @JSONField(name = "totalBalanceCny")
    private double totalBalanceCny;

    @JSONField(name = "balanceInfo")
    private BalanceOlderInfoBean balanceInfo;

    @JSONField(name = "list")
    private List<ListBean> list;

    @JSONField(name = "Clist")
    private List<MyCaptureHeaderListBean> cList;

    public List<MyCaptureHeaderListBean> getcList() {
        return cList;
    }

    public void setcList(List<MyCaptureHeaderListBean> cList) {
        this.cList = cList;
    }

    public double getTotalBalance() {
        return totalBalance;
    }

    public void setTotalBalance(double totalBalance) {
        this.totalBalance = totalBalance;
    }

    public double getTotalBalanceCny() {
        return totalBalanceCny;
    }

    public void setTotalBalanceCny(double totalBalanceCny) {
        this.totalBalanceCny = totalBalanceCny;
    }

    public BalanceOlderInfoBean getBalanceInfo() {
        return balanceInfo;
    }

    public void setBalanceInfo(BalanceOlderInfoBean balanceInfo) {
        this.balanceInfo = balanceInfo;
    }

    public String sstBalanceStr() {
        String sst = AppGlobals.getApplication().getString(R.string.wallet_sst);
        return totalBalance + " " + sst;
    }

    public String cnyBalanceStr() {
        String cny = AppGlobals.getApplication().getString(R.string.wallet_cny);
        return totalBalanceCny + " " + cny;
    }

    public List<ListBean> getList() {
        if (list == null) {
            list = new ArrayList<>();
        }
        return list;
    }

    public void setList(List<ListBean> list) {
        this.list = list;
    }


    public static class BalanceOlderInfoBean  implements Serializable{

        /**
         * bid : 1
         * uid : 3
         * walletAddress : 0xcb94485700525f8c82e82c1983066e8547e966dd
         * sstBalance : 11580.715
         * stBalance : 9000
         * usdtBalance : 0
         * updateTime : 2020-08-29 14:19:27
         * userNumber : 9633395
         * v1TreePt : 0
         * v2TreePt : 0
         * v3TreePt : 0
         * v4TreePt : 0
         * v5TreePt : 0
         * v1TreeHy : 0
         * v2TreeHy : 0
         * v3TreeHy : 1
         * v4TreeHy : 0
         * v5TreeHy : 0
         * v6Tree : 1
         * eusdBalance : 1000
         * cmlBalance : 9219.24
         * cmlBalanceLock : 0
         * account : 22123141234
         * sslBalance : 0
         * arlBalance : 2.2
         * scmlBalance : 200
         * sarlBalance : 200
         * sstBalanceLock : 2
         */

        @JSONField(name = "bid")
        private int bid;

        @JSONField(name = "uid")
        private int uid;

        @JSONField(name = "walletAddress")
        private String walletAddress;

        @JSONField(name = "sstBalance")
        private double sstBalance;

        @JSONField(name = "stBalance")
        private double stBalance;

        @JSONField(name = "usdtBalance")
        private double usdtBalance;

        @JSONField(name = "updateTime")
        private String updateTime;

        @JSONField(name = "userNumber")
        private String userNumber;

        @JSONField(name = "v1TreePt")
        private int v1TreePt;

        @JSONField(name = "v2TreePt")
        private int v2TreePt;

        @JSONField(name = "v3TreePt")
        private int v3TreePt;

        @JSONField(name = "v4TreePt")
        private int v4TreePt;

        @JSONField(name = "v5TreePt")
        private int v5TreePt;

        @JSONField(name = "v1TreeHy")
        private int v1TreeHy;

        @JSONField(name = "v2TreeHy")
        private int v2TreeHy;

        @JSONField(name = "v3TreeHy")
        private int v3TreeHy;

        @JSONField(name = "v4TreeHy")
        private int v4TreeHy;

        @JSONField(name = "v5TreeHy")
        private int v5TreeHy;

        @JSONField(name = "v6Tree")
        private int v6Tree;

        @JSONField(name = "eusdBalance")
        private double eusdBalance;

        @JSONField(name = "cmlBalance")
        private double cmlBalance;

        @JSONField(name = "cmlBalanceLock")
        private double cmlBalanceLock;

        @JSONField(name = "account")
        private String account;

        @JSONField(name = "sslBalance")
        private double sslBalance;

        @JSONField(name = "arlBalance")
        private double arlBalance;

        @JSONField(name = "scmlBalance")
        private double scmlBalance;

        @JSONField(name = "sarlBalance")
        private double sarlBalance;

        @JSONField(name = "sstBalanceLock")
        private double sstBalanceLock;

        @JSONField(name = "integralBalance")
        private BigDecimal integralBalance;

        public BigDecimal getIntegralBalance() {
            return integralBalance;
        }

        public void setIntegralBalance(BigDecimal integralBalance) {
            this.integralBalance = integralBalance;
        }

        public int getBid() {
            return bid;
        }

        public void setBid(int bid) {
            this.bid = bid;
        }

        public int getUid() {
            return uid;
        }

        public void setUid(int uid) {
            this.uid = uid;
        }

        public String getWalletAddress() {
            return walletAddress;
        }

        public void setWalletAddress(String walletAddress) {
            this.walletAddress = walletAddress;
        }

        public double getSstBalance() {
            return sstBalance;
        }

        public void setSstBalance(double sstBalance) {
            this.sstBalance = sstBalance;
        }

        public double getStBalance() {
            return stBalance;
        }

        public void setStBalance(double stBalance) {
            this.stBalance = stBalance;
        }

        public double getUsdtBalance() {
            return usdtBalance;
        }

        public void setUsdtBalance(double usdtBalance) {
            this.usdtBalance = usdtBalance;
        }

        public String getUpdateTime() {
            return updateTime;
        }

        public void setUpdateTime(String updateTime) {
            this.updateTime = updateTime;
        }

        public String getUserNumber() {
            return userNumber;
        }

        public void setUserNumber(String userNumber) {
            this.userNumber = userNumber;
        }

        public int getV1TreePt() {
            return v1TreePt;
        }

        public void setV1TreePt(int v1TreePt) {
            this.v1TreePt = v1TreePt;
        }

        public int getV2TreePt() {
            return v2TreePt;
        }

        public void setV2TreePt(int v2TreePt) {
            this.v2TreePt = v2TreePt;
        }

        public int getV3TreePt() {
            return v3TreePt;
        }

        public void setV3TreePt(int v3TreePt) {
            this.v3TreePt = v3TreePt;
        }

        public int getV4TreePt() {
            return v4TreePt;
        }

        public void setV4TreePt(int v4TreePt) {
            this.v4TreePt = v4TreePt;
        }

        public int getV5TreePt() {
            return v5TreePt;
        }

        public void setV5TreePt(int v5TreePt) {
            this.v5TreePt = v5TreePt;
        }

        public int getV1TreeHy() {
            return v1TreeHy;
        }

        public void setV1TreeHy(int v1TreeHy) {
            this.v1TreeHy = v1TreeHy;
        }

        public int getV2TreeHy() {
            return v2TreeHy;
        }

        public void setV2TreeHy(int v2TreeHy) {
            this.v2TreeHy = v2TreeHy;
        }

        public int getV3TreeHy() {
            return v3TreeHy;
        }

        public void setV3TreeHy(int v3TreeHy) {
            this.v3TreeHy = v3TreeHy;
        }

        public int getV4TreeHy() {
            return v4TreeHy;
        }

        public void setV4TreeHy(int v4TreeHy) {
            this.v4TreeHy = v4TreeHy;
        }

        public int getV5TreeHy() {
            return v5TreeHy;
        }

        public void setV5TreeHy(int v5TreeHy) {
            this.v5TreeHy = v5TreeHy;
        }

        public int getV6Tree() {
            return v6Tree;
        }

        public void setV6Tree(int v6Tree) {
            this.v6Tree = v6Tree;
        }

        public double getEusdBalance() {
            return eusdBalance;
        }

        public void setEusdBalance(double eusdBalance) {
            this.eusdBalance = eusdBalance;
        }

        public double getCmlBalance() {
            return cmlBalance;
        }

        public void setCmlBalance(double cmlBalance) {
            this.cmlBalance = cmlBalance;
        }

        public double getCmlBalanceLock() {
            return cmlBalanceLock;
        }

        public void setCmlBalanceLock(double cmlBalanceLock) {
            this.cmlBalanceLock = cmlBalanceLock;
        }

        public String getAccount() {
            return account;
        }

        public void setAccount(String account) {
            this.account = account;
        }

        public double getSslBalance() {
            return sslBalance;
        }

        public void setSslBalance(double sslBalance) {
            this.sslBalance = sslBalance;
        }

        public double getArlBalance() {
            return arlBalance;
        }

        public void setArlBalance(double arlBalance) {
            this.arlBalance = arlBalance;
        }

        public double getScmlBalance() {
            return scmlBalance;
        }

        public void setScmlBalance(double scmlBalance) {
            this.scmlBalance = scmlBalance;
        }

        public double getSarlBalance() {
            return sarlBalance;
        }

        public void setSarlBalance(double sarlBalance) {
            this.sarlBalance = sarlBalance;
        }

        public double getSstBalanceLock() {
            return sstBalanceLock;
        }

        public void setSstBalanceLock(double sstBalanceLock) {
            this.sstBalanceLock = sstBalanceLock;
        }

        @Override
        public String toString() {
            return "BalanceOlderInfoBean{" +
                    "bid=" + bid +
                    ", uid=" + uid +
                    ", walletAddress='" + walletAddress + '\'' +
                    ", sstBalance=" + sstBalance +
                    ", stBalance=" + stBalance +
                    ", usdtBalance=" + usdtBalance +
                    ", updateTime='" + updateTime + '\'' +
                    ", userNumber='" + userNumber + '\'' +
                    ", v1TreePt=" + v1TreePt +
                    ", v2TreePt=" + v2TreePt +
                    ", v3TreePt=" + v3TreePt +
                    ", v4TreePt=" + v4TreePt +
                    ", v5TreePt=" + v5TreePt +
                    ", v1TreeHy=" + v1TreeHy +
                    ", v2TreeHy=" + v2TreeHy +
                    ", v3TreeHy=" + v3TreeHy +
                    ", v4TreeHy=" + v4TreeHy +
                    ", v5TreeHy=" + v5TreeHy +
                    ", v6Tree=" + v6Tree +
                    ", eusdBalance=" + eusdBalance +
                    ", cmlBalance=" + cmlBalance +
                    ", cmlBalanceLock=" + cmlBalanceLock +
                    ", account='" + account + '\'' +
                    ", sslBalance=" + sslBalance +
                    ", arlBalance=" + arlBalance +
                    ", scmlBalance=" + scmlBalance +
                    ", sarlBalance=" + sarlBalance +
                    ", sstBalanceLock=" + sstBalanceLock +
                    '}';
        }
    }


    public static class ListBean implements Serializable {
        /**
         * tokenType : SST
         * title : 1 SST ≈ 1 CNY
         * balance : 264355.37
         * balanceCny : 264355.37
         * isSupportTrans : 1
         * isSupportReceive : 1
         */

        @JSONField(name = "tokenType")
        private String tokenType;

        @JSONField(name = "title")
        private String title;

        @JSONField(name = "balance")
        private double balance;

        @JSONField(name = "balanceCny")
        private double balanceCny;

        //是否转账
        @JSONField(name = "isSupportTrans")
        private int isSupportTrans;

        //是否收款
        @JSONField(name = "isSupportReceive")
        private int isSupportReceive;

        //已释放
        @JSONField(name = "released")
        private double released;

        //未释放
        @JSONField(name = "notReleased")
        private double notReleased;

        //是否兑换通证
        @JSONField(name = "isExchangePass")
        private int isExchangePass;

        //是否福利积分
        @JSONField(name = "iswelfare")
        private int iswelfare;

        public int getIsExchangePass() {
            return isExchangePass;
        }

        public void setIsExchangePass(int isExchangePass) {
            this.isExchangePass = isExchangePass;
        }

        public int getIswelfare() {
            return iswelfare;
        }

        public void setIswelfare(int iswelfare) {
            this.iswelfare = iswelfare;
        }

        public double getReleased() {
            return released;
        }

        public String getReleasedStr() {
            return String.format(Locale.CHINESE,"%.4f",released);
        }

        public void setReleased(double released) {
            this.released = released;
        }

        public double getNotReleased() {
            return notReleased;
        }

        public String getNotReleasedStr() {
            return String.format(Locale.CHINESE,"%.4f",notReleased);
        }

        public void setNotReleased(double notReleased) {
            this.notReleased = notReleased;
        }

        public String getTokenType() {
            return tokenType;
        }

        public void setTokenType(String tokenType) {
            this.tokenType = tokenType;
        }

        public String getTitle() {
            return title;
        }

        public void setTitle(String title) {
            this.title = title;
        }

        public double getBalance() {
            return balance;
        }

        public String getBalanceStr() {
            return String.format(Locale.CHINESE,"%.4f",balance);
        }

        public void setBalance(double balance) {
            this.balance = balance;
        }

        public double getBalanceCny() {
            return balanceCny;
        }

        public String getBalanceCnyStr() {
            return String.format(Locale.CHINESE,"%.4f",balanceCny);
        }

        public void setBalanceCny(double balanceCny) {
            this.balanceCny = balanceCny;
        }

        public int getIsSupportTrans() {
            return isSupportTrans;
        }

        public void setIsSupportTrans(int isSupportTrans) {
            this.isSupportTrans = isSupportTrans;
        }

        public int getIsSupportReceive() {
            return isSupportReceive;
        }

        public void setIsSupportReceive(int isSupportReceive) {
            this.isSupportReceive = isSupportReceive;
        }
    }
}
